<?php include TMPL_PATH.'public/header.phtml';?>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        <a href='javascript:;' class="on"><em>红包列表</em></a><span>|</span>
        <a href='<?php echo U('promotion/bonus_list');?>' ><em>红包类型</em></a>
    </div>
</div>
<div class="bk"></div>
<div class="pad_10">
<div class="table-list">
    <table width="100%" cellspacing="0" >
        <thead>
            <tr>
            <th align='center' width="200">红包类型</th>
            <th align='center' width="200">订单号</th>
            <th align='center' width="130">使用会员</th>
            <th align='center' width="130">使用时间</th>
            <th align='center' width="140">邮件通知</th>
			<th align='center'>管理操作</th>
			</tr>
        </thead>
    <tbody>
    <?php
   	if(isset($bonusList) && $bonusList):
   		foreach ($bonusList as $v):
   ?>
			<tr>
					<td align='center'><?php $type_name = PromotionModel::getBonusInfo($v['bonus_id']); echo $type_name['type_name'];?></td>
					<td align='center'><?php echo $v['bonus_sn'];?></td>
					<td align='center'><?php $user_id = UserModel::getUserInfo($v['user_id']); echo $user_id['email'];?></td>  
					<td align="center"><?php if($v['used_time'] == 0) echo "未使用"; else echo date('Y-m-d H:i:s',$v['used_time']);?></td>
					<td align="center"><?php if($v['emailed'] > 0) echo "已发成功"; else echo "发送失败";?></td>
					<td align='center'>
                        <?php if($v['used_time']>0): ?>   
                        <a href="javascript:confirmurl('<?php echo U('promotion/user_bonus_regain', 'bonus_id='.$v['id']);?>','确认要恢复<?php  echo $user_id['email'];?>的红包[<?php echo $type_name['type_name'];?>]吗？')">恢复</a>
                        -
                        <?php endif;?>
						<a href="javascript:confirmurl('<?php echo U('promotion/user_bonus_delete', 'bonus_id='.$v['id']);?>','确认要删除吗？')">删除</a>
                    </td>
				</tr>
	<?php 
		endforeach;
		endif;
	?>
   </tbody>
    </table>
<div id="pages"><?php echo $pageShow;?></div>
</div>
</div>
</body>
</html>
